package com.example.logsdemo;

import com.example.logsdemo.service1.DemoService;
import com.example.logsdemo.service2.DemoService2;
import org.springframework.beans.factory.annotation.Autowired;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest
class LogsDemoApplicationTests {

    @Autowired
    private DemoService demoService;

    @Autowired
    private DemoService2 demoService2;

    @Test
    void contextLoads() {
    }

    @Test
    void shouldWriteLogsToSeparateFiles() {
        // service1 -> logs/log1.log
        demoService.calculateSum(1, 2);

        // service2 -> logs/log2.log
        demoService2.process("hello");
        demoService2.simulateError();
    }

}
